<?php
$dDebug=false;
$dSQL="";

$bSubqueriesSupported=true;

$tables_data=array();
$field_labels=array();
$fieldToolTips=array();

//	custom labels
$custom_labels=array();
$custom_labels["Chinese (Hong Kong S.A.R.)"] = array();
	$custom_labels["Chinese (Hong Kong S.A.R.)"]['BRCS'] = "Brcs";
		$custom_labels["Chinese (Taiwan)"] = array();
		$custom_labels["Chinese (Taiwan)"]['BRCS'] = "Brcs";
	$custom_labels["English"] = array();
			$custom_labels["English"]['BRCS'] = "Brcs";

define("FORMAT_NONE","");
define("FORMAT_DATE_SHORT","Short Date");
define("FORMAT_DATE_LONG","Long Date");
define("FORMAT_DATE_TIME","Datetime");
define("FORMAT_TIME","Time");
define("FORMAT_CURRENCY","Currency");
define("FORMAT_PERCENT","Percent");
define("FORMAT_HYPERLINK","Hyperlink");
define("FORMAT_EMAILHYPERLINK","Email Hyperlink");
define("FORMAT_FILE_IMAGE","File-based Image");
define("FORMAT_DATABASE_IMAGE","Database Image");
define("FORMAT_DATABASE_FILE","Database File");
define("FORMAT_FILE","Document Download");
define("FORMAT_LOOKUP_WIZARD","Lookup wizard");
define("FORMAT_PHONE_NUMBER","Phone Number");
define("FORMAT_NUMBER","Number");
define("FORMAT_HTML","HTML");
define("FORMAT_CHECKBOX","Checkbox");
define("FORMAT_MAP","Map");
define("FORMAT_CUSTOM","Custom");

define("FORMAT_AUDIO", "Audio file");
define("FORMAT_DATABASE_AUDIO", "Database audio");
define("FORMAT_VIDEO", "Video file");
define("FORMAT_DATABASE_VIDEO", "Database video");

define("EDIT_FORMAT_NONE","");
define("EDIT_FORMAT_TEXT_FIELD","Text field");
define("EDIT_FORMAT_TEXT_AREA","Text area");
define("EDIT_FORMAT_PASSWORD","Password");
define("EDIT_FORMAT_DATE","Date");
define("EDIT_FORMAT_TIME","Time");
define("EDIT_FORMAT_RADIO","Radio button");
define("EDIT_FORMAT_CHECKBOX","Checkbox");
define("EDIT_FORMAT_DATABASE_IMAGE","Database image");
define("EDIT_FORMAT_DATABASE_FILE","Database file");
define("EDIT_FORMAT_FILE","Document upload");
define("EDIT_FORMAT_LOOKUP_WIZARD","Lookup wizard");
define("EDIT_FORMAT_HIDDEN","Hidden field");
define("EDIT_FORMAT_READONLY","Readonly");

define("EDIT_DATE_SIMPLE",0);
define("EDIT_DATE_SIMPLE_DP",11);
define("EDIT_DATE_DD",12);
define("EDIT_DATE_DD_DP",13);

define("MODE_ADD",0);
define("MODE_EDIT",1);
define("MODE_SEARCH",2);
define("MODE_LIST",3);
define("MODE_PRINT",4);
define("MODE_VIEW",5);
define("MODE_INLINE_ADD",6);
define("MODE_INLINE_EDIT",7);
define("MODE_EXPORT",8);

define("LOGIN_HARDCODED",0);
define("LOGIN_TABLE",1);

define("SECURITY_NONE",-1);
define("SECURITY_HARDCODED", 0);
define("SECURITY_TABLE", 1);

define("ADVSECURITY_ALL",0);
define("ADVSECURITY_VIEW_OWN",1);
define("ADVSECURITY_EDIT_OWN",2);
define("ADVSECURITY_NONE",3);

define("ACCESS_LEVEL_ADMIN","Admin");
define("ACCESS_LEVEL_ADMINGROUP","AdminGroup");
define("ACCESS_LEVEL_USER","User");
define("ACCESS_LEVEL_GUEST","Guest");

define("nDATABASE_MySQL",0);
define("nDATABASE_Oracle",1);
define("nDATABASE_MSSQLServer",2);
define("nDATABASE_Access",3);
define("nDATABASE_PostgreSQL",4);
define("nDATABASE_Informix",5);
define("nDATABASE_SQLite3",6);
define("nDATABASE_DB2",7);

define("ADD_SIMPLE",0);
define("ADD_INLINE",1);
define("ADD_ONTHEFLY",2);
define("ADD_MASTER",3);
define("ADD_POPUP",4);

define("EDIT_SIMPLE",0);
define("EDIT_INLINE",1);
define("EDIT_ONTHEFLY",2);
define("EDIT_POPUP",3);

define("titTABLE",0);
define("titVIEW",1);
define("titREPORT",2);
define("titCHART",3);

// for report lib
define("REPORT_STEPPED", 0);
define("REPORT_BLOCK", 1);
define("REPORT_OUTLINE", 2);
define("REPORT_ALIGN", 3);
define("REPORT_TABULAR", 6);

define("TOTAL_NONE", -1);
define("TOTAL_MAX", 0);
define("TOTAL_AVG", 1);
define("TOTAL_SUM", 3);
define("TOTAL_MIN", 4);

define("LIST_SIMPLE",0);
define("LIST_LOOKUP",1);
define("LIST_DETAILS",3);
define("LIST_AJAX",4);
define("RIGHTS_PAGE", 5);
define("MEMBERS_PAGE", 6);

define("DP_POPUP",0);
define("DP_INLINE",1);
define("DP_NONE",2);

define("SEARCH_SIMPLE",0);
define("SEARCH_LOAD_CONTROL",1);

define("LCT_DROPDOWN",0);
define("LCT_AJAX",1);
define("LCT_LIST",2);
define("LCT_CBLIST",3);

define("LT_LISTOFVALUES",0);
define("LT_LOOKUPTABLE",1);

$globalSettings = array();
$globalSettings["nLoginMethod"] = 1;
$globalSettings["dbType"] = 0;
$globalSettings["isDynamicPerm"] = true;
$globalSettings["createLoginPage"] = true;

$wr_is_standalone=false;


$strLeftWrapper="`";
$strRightWrapper="`";

$cLoginTable				= "users";
$cUserNameField			= "user_name";
$cPasswordField			= "password";
$cUserGroupField			= "user_name";
$cEmailField			= "";

$cUserNameFieldType			= 200;
$cPasswordFieldType			= 200;
$cEmailFieldType			= 200;
								$cUserNameFieldType			= 200;
																																						$cPasswordFieldType			= 200;
								
$gPermissionsRefreshTime=0;
$gPermissionsRead=false;

$nDBType=0;

$useAJAX = true;
$suggestAllContent = true;

$strLastSQL="";

$includes_js=array();
$includes_jsreq=array();
$includes_css=array();

$mlang_messages=array();
$mlang_charsets=array();

// table captions
$tableCaptions = array();
$tableCaptions["English"]=array();
$tableCaptions["English"]["certificate_of_origin_commercials"] = "Certificate Of Origin Commercials";
$tableCaptions["English"]["certificate_of_origin_items"] = "Items";
$tableCaptions["English"]["cities"] = "Cities";
$tableCaptions["English"]["commercial_invoice_items"] = "Items";
$tableCaptions["English"]["commercial_invoices"] = "Commercial Invoices";
$tableCaptions["English"]["companies"] = "Companies";
$tableCaptions["English"]["countries"] = "Countries";
$tableCaptions["English"]["currencies"] = "Currencies";
$tableCaptions["English"]["gsp_commercial_details"] = "Gsp Commercial Details";
$tableCaptions["English"]["gsp_item_details"] = "Items";
$tableCaptions["English"]["modules"] = "Modules";
$tableCaptions["English"]["pack_uoms"] = "Pack Uoms";
$tableCaptions["English"]["packing_list_items"] = "Packing List Items";
$tableCaptions["English"]["packing_lists"] = "Packing Lists";
$tableCaptions["English"]["payment_terms"] = "Payment Terms";
$tableCaptions["English"]["perferences"] = "Perferences";
$tableCaptions["English"]["permissions"] = "Permissions";
$tableCaptions["English"]["ports"] = "Ports";
$tableCaptions["English"]["proforma_invoice_items"] = " Items";
$tableCaptions["English"]["proforma_invoices"] = "Proforma Invoices";
$tableCaptions["English"]["roles"] = "Roles";
$tableCaptions["English"]["shipment_modes"] = "Shipment Modes";
$tableCaptions["English"]["states"] = "States";
$tableCaptions["English"]["uoms"] = "Uoms";
$tableCaptions["English"]["user_pereferences"] = "User Pereferences";
$tableCaptions["English"]["users"] = "Users";
$tableCaptions["English"]["admin_rights"] = "Permissions";
$tableCaptions["English"]["admin_members"] = "Assign users to groups";
$tableCaptions["English"]["admin_users"] = "Add/Edit users";
$tableCaptions["English"]["brcs"] = "Brc";
$tableCaptions["English"]["brc_items"] = "Items";
$tableCaptions["English"]["proforma_invoices_chart"] = "Proforma Invoices Chart";
$tableCaptions["English"]["proforma_invoices_report"] = "Proforma Invoices Report";
$tableCaptions["English"]["packing_lists_report"] = "Packing Lists Report";
$tableCaptions["English"]["commercial_invoices_eport"] = "Commercial Invoices Eport";
$tableCaptions["English"]["brcs_report"] = "Brcs Report";
$tableCaptions["English"]["certificate_of_origin_commercials_report"] = "Certificate Of Origin Commercials Report";
$tableCaptions["English"]["gsp_commercial_details_report"] = "Gsp Commercial Details Report";
$tableCaptions["English"]["brcs_chart"] = "Brcs Chart";
$tableCaptions["English"]["certificate_of_origin_commercials_chart"] = "Certificate Of Origin Commercials Chart";
$tableCaptions["English"]["commercial_invoices_Chart"] = "Commercial Invoices Chart";
$tableCaptions["English"]["gsp_commercial_details_Chart"] = "Gsp Commercial Details Chart";
$tableCaptions["English"]["packing_lists_Chart"] = "Packing Lists Chart";
$tableCaptions["English"]["company_addresses"] = "Company Addresses";
$tableCaptions["English"]["expodoc_uggroups"] = "Expodoc Uggroups";
$tableCaptions["English"]["expodoc_ugmembers"] = "Expodoc Ugmembers";
$tableCaptions["English"]["sales_order_items"] = "Sales Order Items";
$tableCaptions["English"]["sales_orders"] = "Sales Orders";
$tableCaptions["English"]["size_systems"] = "Size Systems";
$tableCaptions["English"]["products"] = "Products";
$tableCaptions["English"]["product_descriptions"] = "Product Descriptions";
$tableCaptions["English"]["master2_properties"] = "Master2 Properties";
$tableCaptions["English"]["master1_properties"] = "Master1 Properties";
$tableCaptions["English"]["colors"] = "Colors";
$tableCaptions["English"]["styles"] = "Styles";
$tableCaptions["English"]["master_properites"] = "Master Properites";
$tableCaptions["English"]["size_breakup"] = "Size Breakup";
$tableCaptions["English"]["sales_order_size_breakup"] = "Sales Order Size Breakup";
$tableCaptions["Chinese (Hong Kong S.A.R.)"]=array();
$tableCaptions["Chinese (Hong Kong S.A.R.)"]["certificate_of_origin_commercials"] = "Certificate Of Origin Commercials";
$tableCaptions["Chinese (Hong Kong S.A.R.)"]["certificate_of_origin_items"] = "Certificate Of Origin Items";
$tableCaptions["Chinese (Hong Kong S.A.R.)"]["cities"] = "Cities";
$tableCaptions["Chinese (Hong Kong S.A.R.)"]["commercial_invoice_items"] = "Commercial Invoice Items";
$tableCaptions["Chinese (Hong Kong S.A.R.)"]["commercial_invoices"] = "Commercial Invoices";
$tableCaptions["Chinese (Hong Kong S.A.R.)"]["companies"] = "Companies";
$tableCaptions["Chinese (Hong Kong S.A.R.)"]["countries"] = "Countries";
$tableCaptions["Chinese (Hong Kong S.A.R.)"]["currencies"] = "Currencies";
$tableCaptions["Chinese (Hong Kong S.A.R.)"]["gsp_commercial_details"] = "Gsp Commercial Details";
$tableCaptions["Chinese (Hong Kong S.A.R.)"]["gsp_item_details"] = "Gsp Item Details";
$tableCaptions["Chinese (Hong Kong S.A.R.)"]["modules"] = "Modules";
$tableCaptions["Chinese (Hong Kong S.A.R.)"]["pack_uoms"] = "Pack Uoms";
$tableCaptions["Chinese (Hong Kong S.A.R.)"]["packing_list_items"] = "Packing List Items";
$tableCaptions["Chinese (Hong Kong S.A.R.)"]["packing_lists"] = "Packing Lists";
$tableCaptions["Chinese (Hong Kong S.A.R.)"]["payment_terms"] = "Payment Terms";
$tableCaptions["Chinese (Hong Kong S.A.R.)"]["perferences"] = "Perferences";
$tableCaptions["Chinese (Hong Kong S.A.R.)"]["permissions"] = "Permissions";
$tableCaptions["Chinese (Hong Kong S.A.R.)"]["ports"] = "Ports";
$tableCaptions["Chinese (Hong Kong S.A.R.)"]["proforma_invoice_items"] = "Proforma Invoice Items";
$tableCaptions["Chinese (Hong Kong S.A.R.)"]["proforma_invoices"] = "Proforma Invoices";
$tableCaptions["Chinese (Hong Kong S.A.R.)"]["roles"] = "Roles";
$tableCaptions["Chinese (Hong Kong S.A.R.)"]["shipment_modes"] = "Shipment Modes";
$tableCaptions["Chinese (Hong Kong S.A.R.)"]["states"] = "States";
$tableCaptions["Chinese (Hong Kong S.A.R.)"]["uoms"] = "Uoms";
$tableCaptions["Chinese (Hong Kong S.A.R.)"]["user_pereferences"] = "User Pereferences";
$tableCaptions["Chinese (Hong Kong S.A.R.)"]["users"] = "Users";
$tableCaptions["Chinese (Hong Kong S.A.R.)"]["admin_rights"] = "Admin Rights";
$tableCaptions["Chinese (Hong Kong S.A.R.)"]["admin_members"] = "Admin Members";
$tableCaptions["Chinese (Hong Kong S.A.R.)"]["admin_users"] = "Admin Users";
$tableCaptions["Chinese (Hong Kong S.A.R.)"]["brcs"] = "Brc";
$tableCaptions["Chinese (Hong Kong S.A.R.)"]["brc_items"] = "Brc Items";
$tableCaptions["Chinese (Hong Kong S.A.R.)"]["proforma_invoices_chart"] = "Proforma Invoices Chart";
$tableCaptions["Chinese (Hong Kong S.A.R.)"]["proforma_invoices_report"] = "Proforma Invoices Report";
$tableCaptions["Chinese (Hong Kong S.A.R.)"]["packing_lists_report"] = "Packing Lists Report";
$tableCaptions["Chinese (Hong Kong S.A.R.)"]["commercial_invoices_eport"] = "Commercial Invoices Eport";
$tableCaptions["Chinese (Hong Kong S.A.R.)"]["brcs_report"] = "Brcs Report";
$tableCaptions["Chinese (Hong Kong S.A.R.)"]["certificate_of_origin_commercials_report"] = "Certificate Of Origin Commercials Report";
$tableCaptions["Chinese (Hong Kong S.A.R.)"]["gsp_commercial_details_report"] = "Gsp Commercial Details Report";
$tableCaptions["Chinese (Hong Kong S.A.R.)"]["brcs_chart"] = "Brcs Chart";
$tableCaptions["Chinese (Hong Kong S.A.R.)"]["certificate_of_origin_commercials_chart"] = "Certificate Of Origin Commercials Chart";
$tableCaptions["Chinese (Hong Kong S.A.R.)"]["commercial_invoices_Chart"] = "Commercial Invoices Chart";
$tableCaptions["Chinese (Hong Kong S.A.R.)"]["gsp_commercial_details_Chart"] = "Gsp Commercial Details Chart";
$tableCaptions["Chinese (Hong Kong S.A.R.)"]["packing_lists_Chart"] = "Packing Lists Chart";
$tableCaptions["Chinese (Hong Kong S.A.R.)"]["company_addresses"] = "Company Addresses";
$tableCaptions["Chinese (Hong Kong S.A.R.)"]["expodoc_uggroups"] = "Expodoc Uggroups";
$tableCaptions["Chinese (Hong Kong S.A.R.)"]["expodoc_ugmembers"] = "Expodoc Ugmembers";
$tableCaptions["Chinese (Hong Kong S.A.R.)"]["sales_order_items"] = "Sales Order Items";
$tableCaptions["Chinese (Hong Kong S.A.R.)"]["sales_orders"] = "Sales Orders";
$tableCaptions["Chinese (Hong Kong S.A.R.)"]["size_systems"] = "Size Systems";
$tableCaptions["Chinese (Hong Kong S.A.R.)"]["products"] = "Products";
$tableCaptions["Chinese (Hong Kong S.A.R.)"]["product_descriptions"] = "Product Descriptions";
$tableCaptions["Chinese (Hong Kong S.A.R.)"]["master2_properties"] = "Master2 Properties";
$tableCaptions["Chinese (Hong Kong S.A.R.)"]["master1_properties"] = "Master1 Properties";
$tableCaptions["Chinese (Hong Kong S.A.R.)"]["colors"] = "Colors";
$tableCaptions["Chinese (Hong Kong S.A.R.)"]["styles"] = "Styles";
$tableCaptions["Chinese (Taiwan)"]=array();
$tableCaptions["Chinese (Taiwan)"]["certificate_of_origin_commercials"] = "Certificate Of Origin Commercials";
$tableCaptions["Chinese (Taiwan)"]["certificate_of_origin_items"] = "Certificate Of Origin Items";
$tableCaptions["Chinese (Taiwan)"]["cities"] = "Cities";
$tableCaptions["Chinese (Taiwan)"]["commercial_invoice_items"] = "Commercial Invoice Items";
$tableCaptions["Chinese (Taiwan)"]["commercial_invoices"] = "Commercial Invoices";
$tableCaptions["Chinese (Taiwan)"]["companies"] = "Companies";
$tableCaptions["Chinese (Taiwan)"]["countries"] = "Countries";
$tableCaptions["Chinese (Taiwan)"]["currencies"] = "Currencies";
$tableCaptions["Chinese (Taiwan)"]["gsp_commercial_details"] = "Gsp Commercial Details";
$tableCaptions["Chinese (Taiwan)"]["gsp_item_details"] = "Gsp Item Details";
$tableCaptions["Chinese (Taiwan)"]["modules"] = "Modules";
$tableCaptions["Chinese (Taiwan)"]["pack_uoms"] = "Pack Uoms";
$tableCaptions["Chinese (Taiwan)"]["packing_list_items"] = "Packing List Items";
$tableCaptions["Chinese (Taiwan)"]["packing_lists"] = "Packing Lists";
$tableCaptions["Chinese (Taiwan)"]["payment_terms"] = "Payment Terms";
$tableCaptions["Chinese (Taiwan)"]["perferences"] = "Perferences";
$tableCaptions["Chinese (Taiwan)"]["permissions"] = "Permissions";
$tableCaptions["Chinese (Taiwan)"]["ports"] = "Ports";
$tableCaptions["Chinese (Taiwan)"]["proforma_invoice_items"] = "Proforma Invoice Items";
$tableCaptions["Chinese (Taiwan)"]["proforma_invoices"] = "Proforma Invoices";
$tableCaptions["Chinese (Taiwan)"]["roles"] = "Roles";
$tableCaptions["Chinese (Taiwan)"]["shipment_modes"] = "Shipment Modes";
$tableCaptions["Chinese (Taiwan)"]["states"] = "States";
$tableCaptions["Chinese (Taiwan)"]["uoms"] = "Uoms";
$tableCaptions["Chinese (Taiwan)"]["user_pereferences"] = "User Pereferences";
$tableCaptions["Chinese (Taiwan)"]["users"] = "Users";
$tableCaptions["Chinese (Taiwan)"]["admin_rights"] = "Admin Rights";
$tableCaptions["Chinese (Taiwan)"]["admin_members"] = "Admin Members";
$tableCaptions["Chinese (Taiwan)"]["admin_users"] = "Admin Users";
$tableCaptions["Chinese (Taiwan)"]["brcs"] = "Brc";
$tableCaptions["Chinese (Taiwan)"]["brc_items"] = "Brc Items";
$tableCaptions["Chinese (Taiwan)"]["proforma_invoices_chart"] = "Proforma Invoices Chart";
$tableCaptions["Chinese (Taiwan)"]["proforma_invoices_report"] = "Proforma Invoices Report";
$tableCaptions["Chinese (Taiwan)"]["packing_lists_report"] = "Packing Lists Report";
$tableCaptions["Chinese (Taiwan)"]["commercial_invoices_eport"] = "Commercial Invoices Eport";
$tableCaptions["Chinese (Taiwan)"]["brcs_report"] = "Brcs Report";
$tableCaptions["Chinese (Taiwan)"]["certificate_of_origin_commercials_report"] = "Certificate Of Origin Commercials Report";
$tableCaptions["Chinese (Taiwan)"]["gsp_commercial_details_report"] = "Gsp Commercial Details Report";
$tableCaptions["Chinese (Taiwan)"]["brcs_chart"] = "Brcs Chart";
$tableCaptions["Chinese (Taiwan)"]["certificate_of_origin_commercials_chart"] = "Certificate Of Origin Commercials Chart";
$tableCaptions["Chinese (Taiwan)"]["commercial_invoices_Chart"] = "Commercial Invoices Chart";
$tableCaptions["Chinese (Taiwan)"]["gsp_commercial_details_Chart"] = "Gsp Commercial Details Chart";
$tableCaptions["Chinese (Taiwan)"]["packing_lists_Chart"] = "Packing Lists Chart";
$tableCaptions["Chinese (Taiwan)"]["company_addresses"] = "Company Addresses";
$tableCaptions["Chinese (Taiwan)"]["expodoc_uggroups"] = "Expodoc Uggroups";
$tableCaptions["Chinese (Taiwan)"]["expodoc_ugmembers"] = "Expodoc Ugmembers";
$tableCaptions["Chinese (Taiwan)"]["sales_order_items"] = "Sales Order Items";
$tableCaptions["Chinese (Taiwan)"]["sales_orders"] = "Sales Orders";
$tableCaptions["Chinese (Taiwan)"]["size_systems"] = "Size Systems";
$tableCaptions["Chinese (Taiwan)"]["products"] = "Products";
$tableCaptions["Chinese (Taiwan)"]["product_descriptions"] = "Product Descriptions";
$tableCaptions["Chinese (Taiwan)"]["master2_properties"] = "Master2 Properties";
$tableCaptions["Chinese (Taiwan)"]["master1_properties"] = "Master1 Properties";
$tableCaptions["Chinese (Taiwan)"]["colors"] = "Colors";
$tableCaptions["Chinese (Taiwan)"]["styles"] = "Styles";
$tableCaptions["French"]=array();
$tableCaptions["French"]["certificate_of_origin_commercials"] = "Certificate Of Origin Commercials";
$tableCaptions["French"]["certificate_of_origin_items"] = "Certificate Of Origin Items";
$tableCaptions["French"]["cities"] = "Cities";
$tableCaptions["French"]["commercial_invoice_items"] = "Commercial Invoice Items";
$tableCaptions["French"]["commercial_invoices"] = "Commercial Invoices";
$tableCaptions["French"]["companies"] = "Companies";
$tableCaptions["French"]["countries"] = "Countries";
$tableCaptions["French"]["currencies"] = "Currencies";
$tableCaptions["French"]["gsp_commercial_details"] = "Gsp Commercial Details";
$tableCaptions["French"]["gsp_item_details"] = "Gsp Item Details";
$tableCaptions["French"]["modules"] = "Modules";
$tableCaptions["French"]["pack_uoms"] = "Pack Uoms";
$tableCaptions["French"]["packing_list_items"] = "Packing List Items";
$tableCaptions["French"]["packing_lists"] = "Packing Lists";
$tableCaptions["French"]["payment_terms"] = "Payment Terms";
$tableCaptions["French"]["perferences"] = "Perferences";
$tableCaptions["French"]["permissions"] = "Permissions";
$tableCaptions["French"]["ports"] = "Ports";
$tableCaptions["French"]["proforma_invoice_items"] = "Proforma Invoice Items";
$tableCaptions["French"]["proforma_invoices"] = "Proforma Invoices";
$tableCaptions["French"]["roles"] = "Roles";
$tableCaptions["French"]["shipment_modes"] = "Shipment Modes";
$tableCaptions["French"]["states"] = "States";
$tableCaptions["French"]["uoms"] = "Uoms";
$tableCaptions["French"]["user_pereferences"] = "User Pereferences";
$tableCaptions["French"]["users"] = "Users";
$tableCaptions["French"]["admin_rights"] = "Admin Rights";
$tableCaptions["French"]["admin_members"] = "Admin Members";
$tableCaptions["French"]["admin_users"] = "Admin Users";
$tableCaptions["French"]["brcs"] = "Brcs";
$tableCaptions["French"]["brc_items"] = "Brc Items";
$tableCaptions["French"]["proforma_invoices_chart"] = "Proforma Invoices Chart";
$tableCaptions["French"]["proforma_invoices_report"] = "Proforma Invoices Report";
$tableCaptions["French"]["packing_lists_report"] = "Packing Lists Report";
$tableCaptions["French"]["commercial_invoices_eport"] = "Commercial Invoices Eport";
$tableCaptions["French"]["brcs_report"] = "Brcs Report";
$tableCaptions["French"]["certificate_of_origin_commercials_report"] = "Certificate Of Origin Commercials Report";
$tableCaptions["French"]["gsp_commercial_details_report"] = "Gsp Commercial Details Report";
$tableCaptions["French"]["brcs_chart"] = "Brcs Chart";
$tableCaptions["French"]["certificate_of_origin_commercials_chart"] = "Certificate Of Origin Commercials Chart";
$tableCaptions["French"]["commercial_invoices_Chart"] = "Commercial Invoices Chart";
$tableCaptions["French"]["gsp_commercial_details_Chart"] = "Gsp Commercial Details Chart";
$tableCaptions["French"]["packing_lists_Chart"] = "Packing Lists Chart";

$globalEvents = new class_GlobalEvents;
$tableEvents = array();

$mlang_defaultlang="English";


$conn=db_connect();
if(!@$_SESSION["UserID"])
{
	$allowGuest=guestHasPermissions();
	$scriptname=getFileNameFromURL();
	if($allowGuest && $scriptname!="login.php" && $scriptname!="remind.php" && $scriptname!="register.php" && $scriptname!="registersuggest.php")
	{
		$_SESSION["UserID"]="Guest";
		$_SESSION["GroupID"]="<Guest>";
		$_SESSION["AccessLevel"]=ACCESS_LEVEL_GUEST;
		$auditObj = GetAuditObject();
		if($auditObj)
			$auditObj->LogLogin();
		if($globalEvents->exists("AfterSuccessfulLogin"))
		{			
			$dummy=array();
			$globalEvents->AfterSuccessfulLogin("","",$dummy);
		}
	}
}

//	old  menu support
//	deprecated
//	remove after version 5.2
$menuTablesArr = array();
$menuTablesArr[] = array("shortTName"=>"ports","dataSourceTName"=>"ports","nType"=>0);
$menuTablesArr[] = array("shortTName"=>"cities","dataSourceTName"=>"cities","nType"=>0);
$menuTablesArr[] = array("shortTName"=>"states","dataSourceTName"=>"states","nType"=>0);
$menuTablesArr[] = array("shortTName"=>"countries","dataSourceTName"=>"countries","nType"=>0);
$menuTablesArr[] = array("shortTName"=>"currencies","dataSourceTName"=>"currencies","nType"=>0);
$menuTablesArr[] = array("shortTName"=>"uoms","dataSourceTName"=>"uoms","nType"=>0);
$menuTablesArr[] = array("shortTName"=>"pack_uoms","dataSourceTName"=>"pack_uoms","nType"=>0);
$menuTablesArr[] = array("shortTName"=>"products","dataSourceTName"=>"products","nType"=>0);
$menuTablesArr[] = array("shortTName"=>"size_systems","dataSourceTName"=>"size_systems","nType"=>0);
$menuTablesArr[] = array("shortTName"=>"product_descriptions","dataSourceTName"=>"product_descriptions","nType"=>0);
$menuTablesArr[] = array("shortTName"=>"payment_terms","dataSourceTName"=>"payment_terms","nType"=>0);
$menuTablesArr[] = array("shortTName"=>"master2_properties","dataSourceTName"=>"master2_properties","nType"=>0);
$menuTablesArr[] = array("shortTName"=>"master1_properties","dataSourceTName"=>"master1_properties","nType"=>0);
$menuTablesArr[] = array("shortTName"=>"colors","dataSourceTName"=>"colors","nType"=>0);
$menuTablesArr[] = array("shortTName"=>"shipment_modes","dataSourceTName"=>"shipment_modes","nType"=>0);
$menuTablesArr[] = array("shortTName"=>"companies","dataSourceTName"=>"companies","nType"=>0);
$menuTablesArr[] = array("shortTName"=>"proforma_invoices","dataSourceTName"=>"proforma_invoices","nType"=>0);
$menuTablesArr[] = array("shortTName"=>"sales_orders","dataSourceTName"=>"sales_orders","nType"=>0);
$menuTablesArr[] = array("shortTName"=>"packing_lists","dataSourceTName"=>"packing_lists","nType"=>0);
$menuTablesArr[] = array("shortTName"=>"commercial_invoices","dataSourceTName"=>"commercial_invoices","nType"=>0);
$menuTablesArr[] = array("shortTName"=>"brcs","dataSourceTName"=>"brcs","nType"=>0);
$menuTablesArr[] = array("shortTName"=>"certificate_of_origin_commercials","dataSourceTName"=>"certificate_of_origin_commercials","nType"=>0);
$menuTablesArr[] = array("shortTName"=>"gsp_commercial_details","dataSourceTName"=>"gsp_commercial_details","nType"=>0);
$menuTablesArr[] = array("shortTName"=>"expodoc_uggroups","dataSourceTName"=>"expodoc_uggroups","nType"=>0);
$menuTablesArr[] = array("shortTName"=>"expodoc_ugmembers","dataSourceTName"=>"expodoc_ugmembers","nType"=>0);
$menuTablesArr[] = array("shortTName"=>"styles","dataSourceTName"=>"styles","nType"=>0);
$menuTablesArr[] = array("shortTName"=>"master_properites","dataSourceTName"=>"master_properites","nType"=>0);
$menuTablesArr[] = array("shortTName"=>"size_breakup","dataSourceTName"=>"size_breakup","nType"=>0);
$menuTablesArr[] = array("shortTName"=>"sales_order_size_breakup","dataSourceTName"=>"sales_order_size_breakup","nType"=>0);


$isGroupSecurity = true;

?>
